import java.util.Scanner;

/**
 * @author vivi
 * @description
 * @date 2024/5/20
 */
public class demo2_standard {
    public static void main(String[] s)
    {
        Scanner in = new Scanner(System.in);
        int t = in.nextInt();
        while(t-- != 0)
        {
            long n = in.nextLong(), a = in.nextLong(), b = in.nextLong();
            long ret = 0;
            if(n <= 2) // 边界情况
            {
                ret = Math.min(a, b);
            }
            else {
                if(a * 3 < b * 2) // 尽可能的选择双⼈船
                {
                    ret += n / 2 * a;
                    n %= 2;
                    if(n == 1)
                    {
                        ret += Math.min(Math.min(a, b), b - a);
                    }
                }
                else // 尽可能的选择三⼈船
                {
                    ret += n / 3 * b;
                    n %= 3;
                    if(n == 1) ret += Math.min(Math.min(a, b), 2 * a - b);
                    if(n == 2) ret += Math.min(Math.min(a, b), 3 * a - b);
                }
            }
            System.out.println(ret);
        }
    }
}
